package cn.com.homeyoda.aimate.aihealth.base;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;

import com.wzq.mvvmsmart.base.BaseModelMVVM;
import com.wzq.mvvmsmart.base.BaseViewModelMVVM;
import com.wzq.mvvmsmart.event.StateLiveData;
import com.wzq.mvvmsmart.http.ResponseThrowable;
import com.wzq.mvvmsmart.utils.KLog;
import com.wzq.mvvmsmart.utils.RxUtils;
import com.wzq.mvvmsmart.utils.ToastUtils;

import cn.com.homeyoda.aimate.aihealth.bean.HomeReportListBean;
import cn.com.homeyoda.aimate.aihealth.ui.videoinspect.VideoInspectModel;
import cn.com.homeyoda.aimate.aihealth.utils.LoadingStateManager;
import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

public class BaseViewModel<M extends BaseModelMVVM> extends BaseViewModelMVVM<M> {
    public final String TAG = getClass().getSimpleName();
    public StateLiveData<Object> stateLiveData;
    protected final LoadingStateManager loadingManager = LoadingStateManager.getInstance();
    public MutableLiveData<Object> getStateLiveData() {
        return stateLiveData;
    }

    public BaseViewModel(@NonNull Application application) {
        super(application);
        stateLiveData = new StateLiveData<>();
    }

    public BaseViewModel(@NonNull Application application, BaseModelMVVM model) {
        super(application, (M) model);
        stateLiveData = new StateLiveData<>();

    }

    @Override
    protected void onCleared() {
        super.onCleared();
        loadingManager.reset();
    }



}
